<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib uri="/struts-tags" prefix="s" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ECSHOP 管理中心 - 添加部门</title>
    <meta name="robots" content="noindex, nofollow"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <%--<jsp:include page="/WEB-INF/views/common.jsp"></jsp:include>--%>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <!-- bootstrap -->
    <link href="/css/bootstrap/bootstrap.css" rel="stylesheet"/>
    <link href="/css/bootstrap/bootstrap-responsive.css" rel="stylesheet"/>
    <link href="/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet"/>


    <!-- libraries -->
    <link href="/css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css"/>
    <link href="/css/lib/font-awesome.css" type="text/css" rel="stylesheet"/>
    <link href="/css/lib/bootstrap-wysihtml5.css" type="text/css" rel="stylesheet"/>
    <link href="/css/lib/uniform.default.css" type="text/css" rel="stylesheet"/>
    <link href="/css/lib/select2.css" type="text/css" rel="stylesheet"/>
    <link href="/css/lib/bootstrap.datepicker.css" type="text/css" rel="stylesheet"/>


    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="/css/layout.css"/>
    <link rel="stylesheet" type="text/css" href="/css/elements.css"/>
    <link rel="stylesheet" type="text/css" href="/css/icons.css"/>

    <!-- this page specific styles -->
    <link rel="stylesheet" href="/css/compiled/form-showcase.css" type="text/css" media="screen"/>


    <!-- open sans font -->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'
          rel='stylesheet' type='text/css'/>

    <!-- lato font -->
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900,300italic,400italic,700italic,900italic'
          rel='stylesheet' type='text/css'/>

    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 引入公用页面 -->
    <script language="javascript">
        // 修改表表单提交地址
        function changeForm() {
            //1. 获取表单对象
            var frm = document.forms[0];

            //2. 修改表单对象的action属性
            // 判断： 添加、修改!  (如果id的值为''说明是添加, 否则是修改)
            var id = document.getElementById('department.id').value;
            if (id == '') {
                // 添加
                frm.action = "${path }/dept_save.action";
            } else {
                // 修改
                frm.action = "${path }/dept_update.action";
            }
            //3. 提交
            frm.submit();
        }
    </script>
</head>
<body>

<div class="table-wrapper orders-table section">
    <div class="row-fluid head">
        <div class="span12">
            <h4>添加部门</h4>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div id="pad-wrapper" class="form-page">
        <form action="${path }/dept_save.action" method="post">
            <!-- 隐藏域，保存id的值（编辑时候用） -->
            <s:hidden name="department.id" id="department.id" value="%{department.id}"></s:hidden>
            <div class="row-fluid form-wrapper">
                <!-- left column -->
                <div class="span8 column">

                    <div class="field-box">
                        <label>部门名称:</label>
                        <s:textfield name="department.departmentName"></s:textfield>
                    </div>
                    <div class="field-box">
                        <label>部门负责人:</label>
                            <s:textfield name="department.manager"></s:textfield>
                    </div>
                    <div class="field-box">
                        <label>备注</label>
                        <s:textarea name="department.remark" cols="50" rows="8"></s:textarea>
                    </div>

                    <!-- 隐藏域： 保单里没有显示，数据库中有； 这种字段用隐藏域 -->
                    <s:hidden name="customer.status"></s:hidden>
                    <s:hidden name="customer.tracecount"></s:hidden>
                    <div class="field-box">
                        <input style="margin-left: 130px;" type="submit" onclick="changeForm()"
                               class=" btn-glow success btn-finish">
                        <input style="margin-left: 133px;" type="reset" class=" btn-glow success btn-finish">
                    </div>

                </div>
            </div>
        </form>
    </div>
</div>
<div style="text-align: center" i>
    共执行 7 个查询，用时 0.028849 秒，Gzip 已禁用，内存占用 3.219 MB<br/>
    版权所有 &copy; 2018-2019 yjxsy1996，并保留所有权利。
</div>
</body>
</html>








